package lq;

import java.util.Scanner;

public class lq2011 {
    public static void main(String[] args){
        Scanner in = new Scanner(System.in);
        int n = in.nextInt();
        int i,x;
        double sum,chu;
        int [] a = new int[n];
        for (i=0;i<n;i++){
            a[i]=in.nextInt();
        }
        for(i=0;i<n;i++){
            x=1;
            sum=0;
            for (int j=0;j<a[i];j++){
                chu=1.0/x;
                sum=sum+chu;
                if (x>0){
                    x=x*-1;
                    x=x-1;
                }
                else {
                    x=x*-1;
                    x=x+1;
                }
            }
            System.out.printf("%.2f", sum);
            System.out.println();
        }
    }
}
